Ref imp even in non-native windows and don't NULL out in destroy so that get_screen...
authorAlexander Larsson <alexl@redhat.com>
Fri, 19 Dec 2008 13:44:51 +0000 (14:44 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:18 +0000 (10:15 +0200)
gdk/gdkwindow.c

index fe76ec7e325abd35e48e52e2297135610048825d..524b3d71e3dc6b17e525f224598742431a4c60ae 100644 (file)
@@ -871,7 +871,7 @@ gdk_window_new (GdkWindow     *parent,
     }
   else
     {
-      private->impl = private->parent->impl;
+      private->impl = g_object_ref (private->parent->impl);
     }
 
   recompute_visible_regions (private, TRUE, FALSE);
@@ -912,7 +912,8 @@ change_impl (GdkWindowObject *private,
   GdkDrawable *old_impl;
 
   old_impl = private->impl;
-  private->impl = new;
+  private->impl = g_object_ref (new);
+  g_object_unref (old_impl);
   
   for (l = private->children; l != NULL; l = l->next)
     {
@@ -1359,8 +1360,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
            {
              /* hide to make sure we repaint and break grabs */
              gdk_window_hide (window);
-             /* NULL out impl so we don't double free it on finalize */
-             private->impl = NULL;
            }
 
          private->state |= GDK_WINDOW_STATE_WITHDRAWN;